/** 
微服务
 **/
package com.centon.auto_code.project.controller;

import com.centon.auto_code.project.service.ProMicroServiceService;
import com.centon.auto_code.project.vo.ProMicroServiceVo;
import com.centon.auto_code.vo.BaseRes;
import java.util.List;
import javax.annotation.Title;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/micro")
public class ProMicroServiceController {

    @Autowired
    private ProMicroServiceService proMicroServiceService;


    /**
     * @gen_405_lwl
     * 获取列表
     * 获取列表
     * @param proMicroServiceVo
    **/
    @Title("获取列表")
    @ResponseBody
    @RequestMapping(value="/list", method=RequestMethod.POST)
    public BaseRes<List<ProMicroServiceVo>> microList(@RequestBody ProMicroServiceVo proMicroServiceVo, BindingResult bindingResult) {
        return proMicroServiceService.microList(proMicroServiceVo);
    }

    /**
     * @gen_406_lwl
     * 添加微服务
     * 添加微服务
     * @param proMicroServiceVo
    **/
    @Title("添加微服务")
    @ResponseBody
    @RequestMapping(value="/add", method=RequestMethod.POST)
    public BaseRes<String> addMicro(@RequestBody ProMicroServiceVo proMicroServiceVo, BindingResult bindingResult) {
        return proMicroServiceService.addMicro(proMicroServiceVo);
    }

    /**
     * @gen_407_lwl
     * 删除微服务
     * 删除微服务
     * @param proMicroServiceVo
    **/
    @Title("删除微服务")
    @ResponseBody
    @RequestMapping(value="/delete", method=RequestMethod.POST)
    public BaseRes<String> deleteMicro(@RequestBody ProMicroServiceVo proMicroServiceVo, BindingResult bindingResult) {
        return proMicroServiceService.deleteMicro(proMicroServiceVo);
    }

    /**
     * @gen_408_lwl
     * 修改微服务
     * 修改微服务
     * @param proMicroServiceVo
    **/
    @Title("修改微服务")
    @ResponseBody
    @RequestMapping(value="/update", method=RequestMethod.POST)
    public BaseRes<String> updateMicro(@RequestBody ProMicroServiceVo proMicroServiceVo, BindingResult bindingResult) {
        return proMicroServiceService.updateMicro(proMicroServiceVo);
    }

    /**
     * @gen_409_lwl
     * 微服务详情
     * 微服务详情
     * @param proMicroServiceVo
    **/
    @Title("微服务详情")
    @ResponseBody
    @RequestMapping(value="/detail", method=RequestMethod.POST)
    public BaseRes<ProMicroServiceVo> microDetail(@RequestBody ProMicroServiceVo proMicroServiceVo, BindingResult bindingResult) {
        return proMicroServiceService.microDetail(proMicroServiceVo);
    }
}